package cn.dlc.com.demo;

/**
 * 用来处理库存
 * @author Administrator
 *
 */
public class Stock {
	
	private static int num = 1;

	public boolean reduceStock() {
		if(num > 0) {
			num--;
			try {
				Thread.sleep(3000);
			} catch (Exception e) {
				e.printStackTrace();
			}
			return true;
		} else {
			return false;
		}
	}
}
